//
//  ChufangdarenCollectionViewCell.m
//  ThePrivateKitchen
//
//  Created by lirui on 16/1/20.
//  Copyright © 2016年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "ChufangdarenCollectionViewCell.h"

@implementation ChufangdarenCollectionViewCell
- (void)dealloc
{
    [_img release];
    [_nick release];
    [_headImage release];
    //[_content release];
    [_time release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        //imgview
        self.img = [[ UIImageView alloc] init];
        //_img.backgroundColor = [ UIColor redColor];
        [self.contentView addSubview:_img];
        [_img release];
        
        self.headImage  =[[UIImageView alloc]init];
        [self.contentView addSubview:_headImage];
        _headImage.layer.cornerRadius = 25;
        _headImage.clipsToBounds = YES;
        [_headImage release];
        
        //titlel
        self.nick =[[  UILabel alloc] init];
        // _title.backgroundColor = [ UIColor greenColor];
        [self.img addSubview:_nick];
        [_nick release];
        _nick.font =[ UIFont systemFontOfSize:14];
        _nick.textAlignment = NSTextAlignmentCenter;
        
        self.time = [[UILabel alloc]init];
        [self.contentView addSubview:_time];
        _time.font = [UIFont systemFontOfSize:12];
        _time.textColor = [UIColor grayColor];
        [_time release];
    }
    return self;
}

//布局方法
- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    _img.frame = CGRectMake(0, 0,189 *WIDTH, 189 *WIDTH);
    _headImage.frame = CGRectMake( WIDTH*5,  HEIGHT*194, WIDTH*50, HEIGHT*50);
    _nick.frame = CGRectMake(60 *WIDTH, HEIGHT*188, WIDTH*100, HEIGHT*40);
    _time.frame = CGRectMake(60*WIDTH, 185+40 *HEIGHT, 80*WIDTH, 30*HEIGHT);
}

@end
